package com.hust.bridgecheck.controller.UserManagement;

import com.hust.bridgecheck.entity.CustomUserData;
import com.hust.bridgecheck.service.UserManagement.UserService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("user")
public class UserPageController {
    @Autowired
    private UserService userService;

    //加载用户相关的serivce
    @GetMapping("/manager")
    @RequiresPermissions("root")
    public String getAllUser(Model model){
        List<CustomUserData> lists = userService.getUserAnGroupInfo();
        model.addAttribute("datalist", lists);
        return "useradd";
    }

}
